<template>
    <div>
        <van-cell title="消息" is-link to="index" />
        <van-cell-group title="个人">
            <van-cell title="消息" is-link to="index" />
            <van-cell title="收藏" is-link to="index" />
        </van-cell-group>
        <van-cell-group title="设置">
            <van-cell title="单元格" is-link to="index" />
        </van-cell-group>
        <van-button type="primary" size="large" color="red" plain @click="lofOut">退出登录</van-button>
    </div>
</template>
<script lang='ts' setup>
import { showConfirmDialog } from 'vant';
import router from '@/router';

function lofOut() {
    showConfirmDialog({
        title: '退出登录',
        message:
            '每日登录，好物多多，折扣多多',
    })
        .then(() => {
            localStorage.removeItem('token');
            localStorage.removeItem('userid');
            router.push('/login')
        })
        .catch(() => {
        });
}
</script>
<style lang='less' scoped>
:deep(.van-cell-group__title) {
    padding: 5px 15px;
}

.van-button {
    margin: 20px 5%;
    width: 90%;
}
</style>